package com.hbpu.encap.arrays;

import java.util.Scanner;

public class Homework03 {
    public static void main(String[] args) {
        System.out.print("请输入人名：");
        String name = new Scanner(System.in).nextLine();
        format(name);
    }

    public static void format(String name) {
        System.out.println("转换后的人名为：");
        String[] s = name.split(" ");
        String format = String.format("%s, %s .%c", s[2], s[1], s[0].toUpperCase().charAt(0));
        System.out.println(format);
    }
}
